package org.bdware.irs.backend.dto;

public enum DoTypeInSuffix {
    //admin标识irs的特殊用户，dou标识irs注册的用户，do标识普通do
    ADMIN("admin"),DOU("dou"),DO("do"),DO_UNKNOWN("");

    private String type;
    private DoTypeInSuffix(String type){
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static DoTypeInSuffix getDoTypeInSuffix(String typeStr){
        for (DoTypeInSuffix type : DoTypeInSuffix.values()) {
            if (type.getType().equals(typeStr)) {
                return type;
            }
        }
        return DoTypeInSuffix.DO_UNKNOWN;
    }

    public static String generatePrefixOfSuffix(String type){
        switch (type){
            case "dou":
                return "dou";
            case "doip":
                return "doip";
            case "ukw":
                return "ukw";
            default:
                return "do";
        }
    }
}
